﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Input;

namespace Leuphana.GuidedTour.App.ViewModels
{
    public class MainViewModel : ViewModelBase
    {
        private ICommand _tourCommand;
        private ICommand _infoCommand;
        private ICommand _settingsCommand;
        private ICommand _firstSpotCommand;
        private ICommand _webBrowserCommand;

        public MainViewModel()
        {
            _webBrowserCommand = new WebBrowserCommand();
            _tourCommand = new NavigationCommand("tour", "type");
            _infoCommand = new NavigationCommand("info");
            _settingsCommand = new NavigationCommand("settings");

            var worker = new BackgroundWorker();
            worker.DoWork += (sender, e) =>
            {
                var tour = App.GetTour();
                _firstSpotCommand = new NavigationCommand("hotspot");

                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    OnPropertyChanged("NavigateToFirstSpotCommand");
                });
            };
            worker.RunWorkerAsync();
        }

        public ICommand NavigateToFirstSpotCommand
        {
            get
            {
                return _firstSpotCommand;
            }
        }
        public ICommand NavigateToTourCommand
        {
            get { return _tourCommand; }
        }
        public ICommand NavigateToInfoCommand
        {
            get { return _infoCommand; }
        }
        public ICommand NavigateToSettingsCommand
        {
            get { return _settingsCommand; }
        }
        public ICommand WebBrowserCommand
        {
            get { return _webBrowserCommand; }
        }
    }
}
